import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { ACLGuard } from '@delon/acl';
import { DictionaryViewComponent } from 'src/app/project/component/icm-global/dictionary/dictionary-view.component';
import { ConfigurationViewComponent } from 'src/app/project/component/icm-global/configuration/configuration-view.component';
import { SystemFileViewComponent } from 'src/app/project/component/icm-global/system-file/system-file-view.component';

const routes: Routes = [
  {
    path: 'dictionary',
    canActivate: [ACLGuard],
    component: DictionaryViewComponent,
    data: {
      title: '字典管理',
      reuse: true,
      guard: {
        role: ['ROLE_ADMIN'],
      },
    },
  },
  {
    path: 'configuration',
    canActivate: [ACLGuard],
    component: ConfigurationViewComponent,
    data: {
      title: '系统全局参数管理',
      reuse: true,
      guard: {
        role: ['ROLE_ADMIN', 'ROLE_SENATOR'],
      },
    },
  },
  {
    path: 'system-file',
    canActivate: [ACLGuard],
    component: SystemFileViewComponent,
    data: {
      title: '文件管理',
      reuse: true,
      guard: {
        role: ['ROLE_ADMIN'],
      },
    },
  },
];
@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class GlobalRoutingModule {}
